package pbf.util;

import javax.swing.JPanel;
import java.awt.Graphics;
import javax.swing.ImageIcon;
import java.awt.Image;
import java.net.URL;

public class JImagePanel extends JPanel {

    Image img;

    public JImagePanel(URL img) {
        this.img = new ImageIcon(img).getImage();
        //this.setOpaque(true);
    }

    public void paintComponent(Graphics g) {
        super.paintComponent(g);
        g.drawImage(img, 0, 0, this.getWidth(), this.getHeight(), this);
    }
}
